package com.aqie.arithmetic.use;

import edu.princeton.cs.algs4.In;
import edu.princeton.cs.algs4.ST;
import edu.princeton.cs.algs4.StdIn;

public class FrequencyCounter {
    public static void main(String[] args) {
        // 最小键长
        int minlen = Integer.parseInt("10");
        ST<String, Integer> st = new ST<>();
        while (!StdIn.isEmpty()){
            String word = StdIn.readString();
            if (word.length() < minlen) continue;
            if (!st.contains(word)) st.put(word, 1);
            else st.put(word, st.get(word) + 1);
        }
    }

}
